<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>

<script type="text/javascript">
	
	$(document).ready(function(){
		//计算出标签的个数
		var tagSize = $("#tag_count").find("a").size();
		//十个样式的数组
		var styleArr = new Array(10);
		styleArr[0] = "font-size:16px;color:#cd55ff;";
		styleArr[1] = "font-size:12px;color:#ff6484;";
		styleArr[2] = "font-size:14px;color:#658491;";
		styleArr[3] = "font-size:12px;color:#aabbcc;";
		styleArr[4] = "font-size:14px;color:#946265;";
		styleArr[5] = "font-size:12px;color:#ff0000;";
		styleArr[6] = "font-size:16px;color:#69ad2d;";
		styleArr[7] = "font-size:12px;color:#000fff;";
		styleArr[8] = "font-size:14px;color:#002aff;";
		styleArr[9] = "font-size:12px;color:#ad3a3a;";
		var tagStyleArr = new Array();
		var index;
		var flag;
		for(var i=0; i<tagSize; i++){
			flag = false;
			index = Math.floor(Math.random()*styleArr.length);
			for(var j=0; j<tagStyleArr.length; j++){
				//判断如果此样式已经有了就break---防止重复
				if(tagStyleArr[j]==styleArr[index]){
					flag = true;
					break;
				}
			}
			if(flag){
				i--;
				continue;
			}
			tagStyleArr[i] = styleArr[index];
		}
		$(".random_style_tag").each(function(i){
			$(this).attr("style",tagStyleArr[i]);
		});
	});
	
</script>

<div class="h_mf">
	<h2>
		<span>
		<c:if test="${friendList!=null && fn:length(friendList)>0 }">
			<a href="javascript:void(0);" onclick="taFriend()">更多</a>
		</c:if>
		</span><a
			href="javascript:void(0);">TA家的邻居</a>
	</h2>
	<div class="h_mf_img">
	<c:if test="${friendList==null || fn:length(friendList)<1 }">
		TA家暂时还没有邻居哦！
	</c:if>
		<ul>
			<c:forEach items="${friendList}" var="friend">
				<li><a class="h_mfImg_pp" href="javascript:void(0);"
					onclick="seeOtherFamily('${friend.doorplate}')" onmouseover="familyTipShow(this,'${friend.doorplate}');" onmouseout="familyTipHide(this);"> <img
						src="${friend.avatar}" width="58" height="58" alt="TA的好友" /> </a><a
					href="javascript:void(0);"
					onclick="seeOtherFamily('${friend.doorplate}')"><c:out
							value="${friend.nickname}" /> </a>
				</li>
			</c:forEach>
			<div class="clear"></div>
		</ul>
	</div>
</div>
<div class="clear"></div>
<div class="h_came">
	<h2>
		<a href="javascript:void(0);">来串门的街坊</a>
	</h2>
	<div class="h_came_img">
	<c:if test="${visitorList==null || fn:length(visitorList)<1 }">
		TA家暂时没有邻居来串门哦！
	</c:if>
		<ul>
			<c:forEach items="${visitorList}" var="visitor">
				<li>
					<div class="newsList_img2 mr5 fn"
						onclick="seeOtherFamily('${visitor.family}')"
						style="cursor: pointer;">
						<div class="own_img" onmouseover="familyTipShow(this,'${visitor.family}');" onmouseout="familyTipHide(this);">
							<img src="${visitor.avatar}" alt="TA的好友" width="58" height="58" />
						</div>
						<div class="others_img">
							<img
								<c:choose>
														<c:when test="${visitor.familyAvatar!=null && visitor.familyAvatar!=''}">
															src="${visitor.familyAvatar}"
														</c:when> 
														<c:otherwise>
															src="images/avatar/family.jpg"
														</c:otherwise>
													</c:choose>
								width="24" height="24" alt="果果街" />
						</div>
					</div> <a href="javascript:void(0);"
					onclick="seeOtherFamily('${visitor.family}')"><c:out
							value="${visitor.visitUsername}" /> </a><span><fmt:formatDate
							value="${visitor.gmtModified}" pattern="MM月dd日" /> </span>
				</li>
			</c:forEach>
			<div class="clear"></div>
		</ul>
	</div>
</div>
<div class="h_tags">
        <h2><a href="javascript:void(0);">(${taFamily.nickname })的标签</a></h2>
        <div class="h_tags_text" id="tag_count">
        	<c:if test="${familyTagList!=null && familyTagList!='[]' && fn:length(familyTagList)>0 }">
        		<c:forEach items="${familyTagList }" var="familyTag" varStatus="v" >
       				<a style="font-size:16px;color:#69ad2d;" class="random_style_tag" href="javascript:void(0);" onclick="javascript:setHash(encodeURI('#toSearchFriendByTag,${familyTag.tagName }'));">${familyTag.tagName }</a>
        		</c:forEach>
        		<br />
        	</c:if>
            <c:if test="${familyTagList==null || familyTagList=='[]' || fn:length(familyTagList)<1 }">
            	TA家暂时还没有贴标签，您可以提醒您的朋友贴上标签哦
            </c:if>
        <div class="clear"></div>
        </div>
      </div>
<%-- 
					<div class="h_sns">
						<h2>
							<span><a href="#">更多</a> </span><a href="#">社区推荐</a>
						</h2>
						<div class="h_sns_text">
						
							<ul>
								<li><img src="<%=basePath%>images/home_images/ico02.png"
									alt="出生" /><a href="#">圈出生活点滴，圈出美好回忆</a></li>
								<li><img src="<%=basePath%>images/home_images/ico23.png"
									alt="出生" /><a href="#">圈出生活点滴，圈出美好回忆</a></li>
								<li><img src="<%=basePath%>images/home_images/ico24.png"
									alt="出生" /><a href="#">圈出生活点滴，圈出美好回忆</a></li>
								<li><img src="<%=basePath%>images/home_images/ico25.png"
									alt="出生" /><a href="#">圈出生活点滴，圈出美好回忆</a></li>
							</ul>
						</div>
					</div>
					--%>
<%--
					<div class="h_newTOP">
						<h2>
							<span><a href="#">更多</a> </span><a href="#">热门话题</a>
						</h2>
						<div class="h_newTOP_text">
						
							<ul>
								<li><a href="#">抚州爆炸(254914)</a></li>
								<li><a href="#">长江中下游旱情持续(228296)</a></li>
								<li><a href="#">小牛晋级总决赛(2637067)</a></li>
								<li><a href="#">分享你的高考故事(3001827)</a></li>
								<li><a href="#">彭帅法网晋级32强(1907</a>5)</li>
								<li><a href="#">抚州爆炸(254914</a>)</li>
								<li><a href="#">长江中下游旱情持续(228296)</a></li>
								<li><a href="#">小牛晋级总决赛(2637067)</a></li>
								<li><a href="#">分享你的高考故事(3001827)</a></li>
								<li><a href="#">彭帅法网晋级32强(19075)</a></li>
							</ul>
							
						</div>
					</div>
					 --%>
